package com.wu.dms.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wu.dms.dao.entity.UserPunishmentRecords;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;

/**
 * @author Cousin
 * @date 2025/1/13
 * @Description
 */
@Mapper
public interface UserPunishmentRecordsMapper extends BaseMapper<UserPunishmentRecords> {
    @Insert(value = "insert into music.user_punishment_records (user_id, status, remark, ban_time, create_time) " +
            "values (#{userId}, #{status}, #{remark}, #{banTime}, #{createTime})")
    void add(Long userId, Integer status, String remark, Date banTime, Date createTime);
    @Delete(value = "update music.user_punishment_records set `delete` = 1 where user_id = #{userId} and `delete` = 0")
    void delete(Long userId);

}
